package cn.com.shadowless.xinning.api;


import java.util.Map;

import cn.com.shadowless.xinning.model.RequestResult;
import cn.com.shadowless.xinning.model.order.AdniminiStrativeOrderInfo;
import cn.com.shadowless.xinning.model.order.ApprovalInfo;
import cn.com.shadowless.xinning.model.order.AssetPayInfo;
import cn.com.shadowless.xinning.model.order.AssetBrokenInfo;
import cn.com.shadowless.xinning.model.order.AssetMoveInfo;
import cn.com.shadowless.xinning.model.order.AssetApplyInfo;
import cn.com.shadowless.xinning.model.order.AssetRegisterCardInfo;
import cn.com.shadowless.xinning.model.order.CarNoInfo;
import cn.com.shadowless.xinning.model.order.CarOrderInfo;
import cn.com.shadowless.xinning.model.order.CheckHistoryList;
import cn.com.shadowless.xinning.model.order.CommunicateOrderInfo;
import cn.com.shadowless.xinning.model.order.CompanyBudgetOrderInfo;
import cn.com.shadowless.xinning.model.order.ContractReviewInfo;
import cn.com.shadowless.xinning.model.order.CostOrderInfo;
import cn.com.shadowless.xinning.model.order.DepartBudgetOrderInfo;
import cn.com.shadowless.xinning.model.order.DepartureOrderInfo;
import cn.com.shadowless.xinning.model.order.GeneralOrderInfo;
import cn.com.shadowless.xinning.model.order.MaintenanceOrderInfo;
import cn.com.shadowless.xinning.model.order.ProcureOrderInfo;
import cn.com.shadowless.xinning.model.order.PublicAssetsApplyInfo;
import cn.com.shadowless.xinning.model.order.SupplierInfo;
import cn.com.shadowless.xinning.model.order.TrainOrderInfo;
import cn.com.shadowless.xinning.model.order.TransportOrderInfo;
import cn.com.shadowless.xinning.model.order.TravelOrderInfo;
import io.reactivex.Observable;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Url;

/**
 * The interface Expense app.
 *
 * @author sHadowLess
 */
public interface Order {

    /**
     * General order info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/GeneralExpandForm/LoadAppFormById")
    Observable<RequestResult<GeneralOrderInfo>> generalOrderInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Adnimini strative info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/AdministrationAffExpAccount/LoadExpenseAcountById")
    Observable<RequestResult<AdniminiStrativeOrderInfo>> adniminiStrativeInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Cost order info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/ExpenseAppForm/LoadAppFormById")
    Observable<RequestResult<CostOrderInfo>> costOrderInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Communicate info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/CommunicationAppForm/LoadAppFormById")
    Observable<RequestResult<CommunicateOrderInfo>> communicateInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Travel info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/TravelAppForm/LoadAppFormById")
    Observable<RequestResult<TravelOrderInfo>> travelInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Train order info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/EducationAppForm/LoadAppFormById")
    Observable<RequestResult<TrainOrderInfo>> trainOrderInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Maintenance order info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/CareConfirmAppForm/LoadAppFormById")
    Observable<RequestResult<MaintenanceOrderInfo>> maintenanceOrderInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Depart budget order info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/Budget/LoadBudgetNoInfoById")
    Observable<RequestResult<DepartBudgetOrderInfo>> departBudgetOrderInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Departure order info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/UserResignApply/LoadResignApplyById")
    Observable<RequestResult<DepartureOrderInfo>> departureOrderInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Company budget order info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/Budget/LoadBudgetNoInfoById")
    Observable<RequestResult<CompanyBudgetOrderInfo>> companyBudgetOrderInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Transport order info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/Pay/LoadPayInfoById")
    Observable<RequestResult<TransportOrderInfo>> transportOrderInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Car order info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/UseCarApply/LoadUseCarApplyDetail")
    Observable<RequestResult<CarOrderInfo>> carOrderInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Car no info observable.
     *
     * @param carNo      the car no
     * @param driverName the driver name
     * @param pageIndex  the page index
     * @param usage      the usage
     * @param head       the head
     * @return the observable
     */
    @GET("api/CarInfo/LoadCarInfoList")
    Observable<RequestResult<CarNoInfo>> carNoInfo(
            @Query("carNo") String carNo,
            @Query("driverName") String driverName,
            @Query("pageIndex") String pageIndex,
            @Query("usage") String usage,
            @Header("Account") String head
    );

    /**
     * Procure order info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/PublicResourcePurchaseOrder/LoadPurchaseOrderById")
    Observable<RequestResult<ProcureOrderInfo>> procureOrderInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Asset register card info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/FixedAssets/LoadAppFormById")
    Observable<RequestResult<AssetRegisterCardInfo>> assetRegisterCardInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Asset move info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/Allot/LoadAppFormById")
    Observable<RequestResult<AssetMoveInfo>> assetMoveInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Asset broken info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/Scrap/LoadAppFormById")
    Observable<RequestResult<AssetBrokenInfo>> assetBrokenInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Check pass observable.
     *
     * @param map  the map
     * @param head the head
     * @return the observable
     */
    @FormUrlEncoded
    @POST("api/signed/CheckPass")
    Observable<RequestResult<Object>> checkPass(
            @FieldMap Map<String, String> map,
            @Header("Account") String head
    );

    /**
     * Check reject pre observable.
     *
     * @param map  the map
     * @param head the head
     * @return the observable
     */
    @FormUrlEncoded
    @POST("api/signed/CheckRejectPre")
    Observable<RequestResult<Object>> checkRejectPre(
            @FieldMap Map<String, String> map,
            @Header("Account") String head
    );

    /**
     * Check reject apply observable.
     *
     * @param map  the map
     * @param head the head
     * @return the observable
     */
    @FormUrlEncoded
    @POST("api/signed/CheckRejectApply")
    Observable<RequestResult<Object>> checkRejectApply(
            @FieldMap Map<String, String> map,
            @Header("Account") String head
    );


    /**
     * Check history list observable.
     *
     * @param url  the url
     * @param head the head
     * @return the observable
     */
    @GET()
    Observable<RequestResult<CheckHistoryList>> checkHistoryList(
            @Url String url,
            @Header("Account") String head
    );

    /**
     * Supplier info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/Partners/LoadPartnersById")
    Observable<RequestResult<SupplierInfo>> supplierInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Public assets apply info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/PublicResourceRequiredOrder/LoadApplyDetailById")
    Observable<RequestResult<PublicAssetsApplyInfo>> publicAssetsApplyInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Contract review info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/Contract/LoadContractById")
    Observable<RequestResult<ContractReviewInfo>> contractReviewInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Approval info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/ApprovalAppForm/LoadApprovalById")
    Observable<RequestResult<ApprovalInfo>> approvalInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Asset apply info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/FixedExpandForm/LoadFormById")
    Observable<RequestResult<AssetPayInfo>> assetPayInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );

    /**
     * Asset pay info observable.
     *
     * @param orderNo the order no
     * @param head    the head
     * @return the observable
     */
    @GET("api/FixedAppForm/LoadAppFormById")
    Observable<RequestResult<AssetApplyInfo>> assetApplyInfo(
            @Query("id") String orderNo,
            @Header("Account") String head
    );
}
